package com.example.self_timer.timer;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created on 2021/6/7.
 *
 * @author Alan
 * @since 1.0
 */
public class TimerTest {

    public static void main(String[] args) {
        TimerManager timerManager = new TimerManager();
        timerManager.go();
        AtomicInteger intValue = new AtomicInteger();
        long startTime = System.currentTimeMillis();

        for(int i = 0; i< 500;i++){
            timerManager.add(() -> {
                long endTime = System.currentTimeMillis();
                System.out.println("end:" + (endTime - startTime));
            }, 10000);
        }

        try {
            Thread.sleep(50000000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println("end:" + intValue.get());

    }
}
